# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
#
# Initial PKGBUILD from AUR.
# Old Maintainer: K4YT3X <aur@k4yt3x.com>
# Old Maintainer: TobFromme

pkgname=sdrtrunk
pkgver=0.6.0
pkgrel=1
pkgdesc='A cross-platform java application for decoding, monitoring, recording and streaming trunked mobile and related radio protocols using SDR.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-radio')
url='https://github.com/DSheirer/sdrtrunk'
license=('GPL3')
depends=('at-spi2-core' 'libnet' 'alsa-lib' 'gtk3' 'java-environment')
source=("$pkgname.desktop")
source_x86_64=("https://github.com/DSheirer/sdrtrunk/releases/download/v$pkgver/sdr-trunk-linux-x86_64-v$pkgver.zip")
source_aarch64=("https://github.com/DSheirer/sdrtrunk/releases/download/v$pkgver/sdr-trunk-linux-aarch64-v$pkgver.zip")
sha512sums=('a43ac3aaf880b2e34d8d8b2b35c706d3501679ceee57e2c1e6b7e28c9c5b2db983ec39ad96d40021be1a2e370e1519de083916a7c6d54cd1a7f13b3923cdb0d0')
sha512sums_x86_64=('77d1c6eab15897a9e8a3afe0627d37a798d0591fc5e7d3b8178dcf06012f57995c8353bfcedbfdc306b469afd675b318992230177f948fdf5367f08281e04365')
sha512sums_aarch64=('33e1621f9cb8122021cf168a574aea65d9e08767655d48b67df55c6dabcbc8199e7d8a81cf17f8ac044152c00f62fd2f02e471fac4b252ed89feffcf8b8eb1b1')

package() {
  cd "sdr-trunk-linux-$CARCH-v$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -ra * "$pkgdir/usr/share/$pkgname/"

  install -Dm 644 "$srcdir/$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"

  ln -s "/usr/share/sdrtrunk/bin/sdr-trunk" "$pkgdir/usr/bin/sdr-trunk"
}

